package com.sltx.test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.regex.Pattern;

/**
 * @Author Administrator
 * @Date 2023/9/1 13:42
 */
public class test {

    public static void main(String[] args) {
        //Date d = new Date();
        //SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        //System.out.println("十天前的日期：" + df.format(new Date(d.getTime() - 10 * 24 * 60 * 60 * 1000)));//10天前的日期
        String entnames =
                "GB/T 35968-2018," +
                "2018-02-06,2018-09-01," +
                "产品," +
                "A47,07.060\n" +
                "\n" +
                "\n" +
                "\n" +
                "07 数学、自然科学\n" +
                "07.060 地质学、气象学、水文学,全国气象防灾减灾标准化技术委员会,全国气象防灾减灾标准化技术委员会,中国气象局";
        String[] split = entnames.split(",");
        ArrayList<String> list = new ArrayList<>();
        Pattern pattern = Pattern.compile("[0-9]");
        int a = 0;
        for (int i = 0; i < split.length; i++) {
            if (pattern.matcher(split[i]).find()){ //如果包含数字
                 a = i;
            }else {
                list.add(split[i]);
            }
        }
        System.out.println("索引是:======>"+a);
        ArrayList<String> list1 = new ArrayList<>(Arrays.asList(split));
        list1.subList(0,a+1).clear();
        String replace = list1.toString().replace("[", "").replace("]", "");
        System.out.println(replace);


    }





}
